package com.dragon.mmochat.message;

import com.dragon.mmochat.MmochatConstant;
import com.skymobi.buffer.SkymobiBuffer;
import com.skymobi.message.SkymobiModuleMessage;

public class Mmochat_ServerInfoMessage extends SkymobiModuleMessage {
	private int curServerInstanceId; // 当前服务器的实例号
	private int curServerPlayerNum; // 当前服务器的在线玩家人数
	private long version;

	public Mmochat_ServerInfoMessage() {
		setDstId(MmochatConstant.serverListModuleId);
		setMsgCode(MmochatConstant.MSGCODE_MMOCHAT_C_1_12);
	}

	public int getCurServerInstanceId() {
		return curServerInstanceId;
	}

	public void setCurServerInstanceId(int curServerInstanceId) {
		this.curServerInstanceId = curServerInstanceId;
	}

	public int getCurServerPlayerNum() {
		return curServerPlayerNum;
	}

	public void setCurServerPlayerNum(int curServerPlayerNum) {
		this.curServerPlayerNum = curServerPlayerNum;
	}

	public long getVersion() {
		return version;
	}

	public void setVersion(long version) {
		this.version = version;
	}

	@Override
	protected void decodeBody(SkymobiBuffer in) {
		curServerInstanceId = in.getInt();
		curServerPlayerNum = in.getInt();
		version = in.getLong();
	}

	@Override
	protected void encodeBody(SkymobiBuffer out) {
		out.putInt(curServerInstanceId);
		out.putInt(curServerPlayerNum);
		out.putLong(version);
	}
}
